package com.ruoyi.pms.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.pms.mapper.PmsProductSkuMapper;
import com.ruoyi.pms.domain.PmsProductSku;
import com.ruoyi.pms.service.IPmsProductSkuService;

/**
 * 产品SKUService业务层处理
 * 
 * @author zouhuu
 * @date 2021-07-20
 */
@Service
public class PmsProductSkuServiceImpl implements IPmsProductSkuService 
{
    @Autowired
    private PmsProductSkuMapper pmsProductSkuMapper;

    /**
     * 查询产品SKU
     * 
     * @param id 产品SKUID
     * @return 产品SKU
     */
    @Override
    public PmsProductSku selectPmsProductSkuById(Long id)
    {
        return pmsProductSkuMapper.selectPmsProductSkuById(id);
    }

    /**
     * 查询产品SKU列表
     * 
     * @param pmsProductSku 产品SKU
     * @return 产品SKU
     */
    @Override
    public List<PmsProductSku> selectPmsProductSkuList(PmsProductSku pmsProductSku)
    {
        return pmsProductSkuMapper.selectPmsProductSkuList(pmsProductSku);
    }

    /**
     * 新增产品SKU
     * 
     * @param pmsProductSku 产品SKU
     * @return 结果
     */
    @Override
    public int insertPmsProductSku(PmsProductSku pmsProductSku)
    {
        pmsProductSku.setCreateTime(DateUtils.getNowDate());
        return pmsProductSkuMapper.insertPmsProductSku(pmsProductSku);
    }

    /**
     * 修改产品SKU
     * 
     * @param pmsProductSku 产品SKU
     * @return 结果
     */
    @Override
    public int updatePmsProductSku(PmsProductSku pmsProductSku)
    {
        pmsProductSku.setUpdateTime(DateUtils.getNowDate());
        return pmsProductSkuMapper.updatePmsProductSku(pmsProductSku);
    }

    /**
     * 批量删除产品SKU
     * 
     * @param ids 需要删除的产品SKUID
     * @return 结果
     */
    @Override
    public int deletePmsProductSkuByIds(Long[] ids)
    {
        return pmsProductSkuMapper.deletePmsProductSkuByIds(ids);
    }

    /**
     * 删除产品SKU信息
     * 
     * @param id 产品SKUID
     * @return 结果
     */
    @Override
    public int deletePmsProductSkuById(Long id)
    {
        return pmsProductSkuMapper.deletePmsProductSkuById(id);
    }
}
